
# 协程订单出队
import asyncio

# 引入队列
from tools import OrderQueue


# 出队方法

async def dojob():
    oq = OrderQueue('order')

    # 出队
    oq.out()


# 声明协程方法
async def main():
    # 建立协程对象

    task1 = asyncio.ensure_future(dojob())
    task2 = asyncio.ensure_future(dojob())
    task3 = asyncio.ensure_future(dojob())

    tasks = [task1, task2]

    res = await asyncio.gather(*tasks)


asyncio.run(main())
